package com.settlement.system.rules;

import com.settlement.system.model.entity.SysAudit;
import com.settlement.system.model.entity.SysAuditRule;

public class RuleChecker {
    public static boolean check(String ruleCode, SysAudit sysAudit, SysAuditRule auditRule) {
        CommonRuler ruler;
        switch (ruleCode) {
            case "2b-2":
                ruler = new AllGoodsAlreadyReturnAndNotRefundRuler();
                return ruler.check(sysAudit, auditRule);
            case "8":
                ruler = new AllGoodsReturnRuler();
                return ruler.check(sysAudit, auditRule);
            case "3b-1":
                ruler = new AlreadyReceiveMoneyNotSendGoodsRuler();
                return ruler.check(sysAudit, auditRule);
            case "14b":
                ruler = new FinanceManualFlatAccountRuler();
                return ruler.check(sysAudit, auditRule);
            case "15":
                ruler = new HasEndRuler();
                return ruler.check(sysAudit, auditRule);
            case "9b-1":
                ruler = new HasSendNotReceiveMoneyRuler();
                return ruler.check(sysAudit, auditRule);
            case "9b-2":
                ruler = new HasSendNotReceiveMoneySecondRuler();
                return ruler.check(sysAudit, auditRule);
            case "9b-7":
                ruler = new HasSendNotReturnNotReceiveMoneyHasRefundRuler();
                return ruler.check(sysAudit, auditRule);
            case "9b-4":
                ruler = new HasSendPartReceiveMoneyRuler();
                return ruler.check(sysAudit, auditRule);
            case "9b-5":
                ruler = new HasSendReturnAndNotReceiveMoneyRuler();
                return ruler.check(sysAudit, auditRule);
            case "9b-3":
                ruler = new HasSendReturnAndPartReceiveMoneyRuler();
                return ruler.check(sysAudit, auditRule);
            case "9b-6":
                ruler = new HasSendReturnNotReceiveMoneyHasRefundRuler();
                return ruler.check(sysAudit, auditRule);
            case "14c":
                ruler = new InnerSystemAndFinanceManualFlatAccountRuler();
                return ruler.check(sysAudit, auditRule);
            case "14a":
                ruler = new InnerSystemFlatAccountRuler();
                return ruler.check(sysAudit, auditRule);
            case "1":
                ruler = new NoReturnNoRefundRuler();
                return ruler.check(sysAudit, auditRule);
            case "5b":
                ruler = new NotReturnGoodsHasRefundRuler();
                return ruler.check(sysAudit, auditRule);
            case "10":
                ruler = new NotSendGoodsRefundOnlyRuler();
                return ruler.check(sysAudit, auditRule);
            case "7":
                ruler = new NotSendHasReceiveHasRefundRuler();
                return ruler.check(sysAudit, auditRule);
            case "2a-1":
                ruler = new OverdueNoRefundRuler();
                return ruler.check(sysAudit, auditRule);
            case "2a-2":
                ruler = new OverdueNoRefundSystemNoAdjustRuler();
                return ruler.check(sysAudit, auditRule);
            case "3a-1":
                ruler = new OverdueReceiveBillNoSendRuler();
                return ruler.check(sysAudit, auditRule);
            case "3a-2":
                ruler = new OverdueReceiveBillPartSkuNoSendRuler();
                return ruler.check(sysAudit, auditRule);
            case "5a":
                ruler = new OverdueRefundNoReturnRuler();
                return ruler.check(sysAudit, auditRule);
            case "9a-3":
                ruler = new OverdueReturnNoRefundPartNoReceiveRuler();
                return ruler.check(sysAudit, auditRule);
            case "9a-7":
                ruler = new OverdueSendNoReceiveNoReturnRefundRuler();
                return ruler.check(sysAudit, auditRule);
            case "9a-6":
                ruler = new OverdueSendNoReceiveReturnRefundRuler();
                return ruler.check(sysAudit, auditRule);
            case "9a-1":
                ruler = new OverdueSendNoReceiveRuler();
                return ruler.check(sysAudit, auditRule);
            case "9a-5":
                ruler = new OverdueSendNoReceiveSecondRuler();
                return ruler.check(sysAudit, auditRule);
            case "9a-2":
                ruler = new OverdueSendPartNoReceiveRuler();
                return ruler.check(sysAudit, auditRule);
            case "9a-4":
                ruler = new OverdueSendPartNoReceiveSecondRuler();
                return ruler.check(sysAudit, auditRule);
            case "2b-1":
                ruler = new PartGoodsAlreadyReturnAndNotRefundRuler();
                return ruler.check(sysAudit, auditRule);
            case "3b-2":
                ruler = new PartGoodsNotSendRuler();
                return ruler.check(sysAudit, auditRule);
            case "4":
                ruler = new PartGoodsReturnOnlyRuler();
                return ruler.check(sysAudit, auditRule);
            case "12a":
                ruler = new ReceiveDiffMoneyRuler();
                return ruler.check(sysAudit, auditRule);
            case "13a":
                ruler = new ReturnDiffMoneyRuler();
                return ruler.check(sysAudit, auditRule);
            case "6":
                ruler = new ReturnGoodsReturnMoneyRuler();
                return ruler.check(sysAudit, auditRule);
            default:
                return false;

        }
    }

}
